<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    var nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 1];
    var sum = 0;
    var len = nums.length;
    for (let i = 0; i < nums.length; i++) {

        sum += nums[i];
    }
    alert(sum / len);


</script>
<body>

</body>
</html>